﻿@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>高德地图</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="icon" href="/favicon.ico">
    <link rel="stylesheet" href="/resources/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="/resources/css/public.css" media="all" />
    <link rel="stylesheet" href="/resources/layui_ext/dtree/dtree.css" media="all" />
    <link rel="stylesheet" href="/resources/layui_ext/dtree/font/dtreefont.css" media="all" />

    <link href="/resources/gdMap/ped-theme.css" rel="stylesheet" />
    <link href="/resources/gdMap/Map/center.css" rel="stylesheet" />
    <link href="/resources/gdMap/Map/style.css" rel="stylesheet" />
    <style>
        html {
            overflow: hidden;
        }
    </style>

</head>

<body class="childrenBody">

        <div id="container" style="width:100%;height:100%;">
            <div id="contract" style="width:100%;height:100%;">
                <choosemap ref="test" :id="'contract'" :lnglats="lnglats" :anydetailed="anydetailed" :addrdetail="addrdetail" :get_address_after="after"></choosemap>
            </div>
        </div>
        <div class="loadingPanel" style="display: none;">
            <div class="loading-shade"></div>
            <div class="loading-content" onclick="$.loading(false)">数据加载中，请稍后…</div>
        </div>

<!--引入Jq-->
<script src="/resources/gdMap/jquery/jquery-1.11.1.js"></script>
<!--关闭layer弹框-->
<script src="/resources/gdMap/layer-v2.4/layer.js?v=20210216"></script>
<!--弹出提示-->
<script src="/resources/gdMap/ped.js?v=20210216"></script>
@* 引入vue *@
<script src="/resources/gdMap/Vue/vue.min.js"></script>
@* 地图引入*@
<script src="https://webapi.amap.com/maps?v=1.4.15&key=66bebb4e102fdf87d2d98303fc8a2e1d&plugin=AMap.Autocomplete,AMap.PlaceSearch,AMap.Geocoder"></script>
@*输入提示*@
<script type="text/javascript" src="https://cache.amap.com/lbs/static/addToolbar.js"></script>
<script src="/resources/gdMap/Map/MapSelect.js?v=20210216"></script>

<script type="text/javascript">
    var app = new Vue({
        el: "#container",
        data: function () {
            return {
                lnglats: eval('@Html.Raw(ViewBag.lnglats.ToString())'),
                anydetailed: @(ViewBag.anydetailed.ToString().ToLower()),
                addrdetail: '@ViewBag.address',
            }
        },
        components: {
            choosemap: choose_map
        },
        mounted: function () {
            this.init()
        },
        methods: {
            init: function () {
            },
            after: function (result) {
                //$.loading(true, "正在获取地址");
                $.ajax({
                    url: "/GdMap/GetRegion",
                    data: { province: result.getprovince, city: result.getcity, area: result.getdistrict, adCode: result.getadcode },
                    dataType: 'json',
                    method: 'post',
                    async: true,
                    success: function (data) {
                        //$.loading(false);
                        if (data.Code == 200) {
                            data.Data["Lnglats"] = result.getlnglats;
                            data.Data["Address"] = result.getaddrdetail;
                            //console.log(data)
                            try { window.parent.GetAddressInfo(data.Data, "*"); } catch (e) { };
                            window.parent.layer.closeAll();//关闭弹窗
                        }
                        else {
                            $.modalAlert(data.Message);
                        }
                    },
                    error: function (xhr, errorText, error) {
                        $.modalAlert("数据异常");
                    }
                });
            },
        }
    });
</script>
</body>
</html>
